import {createStore , applyMiddleware} from 'redux'
import {reduxLogger} from 'redux-logger'
import {thunk} from 'redux-thunk';
import promise from 'redux-promise'
import reducer from './reducer'

/* 根据不同的环境区分不同的中间件 */
let arr = [thunk , promise],
    env = process.env.NODE_ENV
    if(env === "development"){
        arr.push(reduxLogger)
    }

// 创建store容器
const store = createStore(
    reducer,
    // applyMiddleware(...arr)
    )

export default store